package ee.karileet.productcatalogue.app;

import ee.karileet.productcatalogue.facade.IClientFacade;
import ee.karileet.productcatalogue.facade.impl.ClientFacade;
import ee.karileet.productcatalogue.model.Group;
import ee.karileet.productcatalogue.model.Manufactor;
import ee.karileet.productcatalogue.model.Product;

public class App {

	public static void main(String[] args) {
		IClientFacade facade = new ClientFacade();
		for(Group g : facade.listGroups()) {
			System.out.println(g.getName());
			for(Product p : facade.listProductsByGroup(g.getId())) {
				System.out.println("- " + p.getName() + " " + p.getType());
			}
		}
		
		for (Manufactor m : facade.listManufactors()) {
			System.out.println(m.getName());
			for(Product p : facade.listProductsByManufactor(m.getId())) {
				System.out.println("- " + p.getName() + " " + p.getType());
			}
		}
	}
}
